<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/base/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="css/base/weui.min.css" />
		<link rel="stylesheet" type="text/css" href="css/base/public.css" />
	</head>
	<style type="text/css">
		.personal_centerTop {
			position: fixed;
			top: 0px;
			height: 50px;
			width: 100%;
			display: -webkit-box;
		}
		
		.top_fanhui {
			width: 50px;
			font-size: 20px;
			text-align: center;
			line-height: 50px;
			color: #FFF;
		}
		
		.top_name {
			-webkit-box-flex: 1;
			font-size: 18px;
			line-height: 50px;
			color: #FFF;
		}
		
		.content {
			padding: 50px 0px;
		}
		
		.contentLogo {
			border: 1px solid #ddd;
			height: 35vh;
			width: 100%;
		}
		
		.logo {
			border: 1px solid;
			width: 110px;
			height: 110px;
			border-radius: 110px;
			margin: auto;
			margin-top: 50px;
			line-height: 110px;
			font-size: 100px;
			background-color: #13A311;
			color: #fff;
			text-align: center;
		}
		
		.logoTxt {
			text-align: center;
			margin-top: 10px;
			color: #666;
			font-weight: bolder;
			/*font-size: 12px;*/
		}
		
		.xiaoxiIcon {
			border: 1px solid;
			font-size: 22px;
			border-radius: 50px;
			padding: 0px 7px 0px 7px;
			background-color: #13A311;
			color: white;
		}
	</style>

	<body>
		<div class="personal_centerTop top_blue">
			<div onclick="location.href='personal.html'" class="top_fanhui Hui-iconfont Hui-iconfont-slider-left"></div>
			<div class="top_name font-weight">我的行程</div>
		</div>

		<!--内容开始-->
		<div class="content">
			<div>
				<a class="weui-cell weui-cell_access" href="#" v-for="item in list">
					<div class="Hui-iconfont Hui-iconfont-manage font_color6 m_right10 xiaoxiIcon"></div>
					<div class="weui-cell__bd weui-cell_primary">
						<p class="font-size14 font_color3" v-html="item.createdAt">使用日期</p>
						<p class="font-size9 font_color6">车牌号：<span v-html="item.bikeNumber"></span>&nbsp;&nbsp;&nbsp;&nbsp;花费：<span v-html="item.pay"></span> 元&nbsp;&nbsp;&nbsp;&nbsp;时长：<span v-html="item.bikeTime"></span> </p>
					</div>
					<!--<span class="weui-cell__ft"></span>-->
				</a>

			</div>
		</div>
		<!--内容结束-->
		<!--底部按钮开始-->
		<div class="weui-tabbar footer">
			<a href="index.html" class="weui-tabbar__item ">
				<p style="color: rgba(153,153,153,1);" class="footertab_blue weui-tabbar__label Hui-iconfont Hui-iconfont-saoyisao "></p>
			</a>
			<a href="IM.html " class="weui-tabbar__item ">
				<p class="weui-tabbar__label Hui-iconfont Hui-iconfont-xiaoxi1 "></p>
			</a>
			<a href="personal.html " class="weui-tabbar__item ">
				<p class="footertab_blue weui-tabbar__label Hui-iconfont Hui-iconfont-user "></p>
			</a>
		</div>
		<!--底部按钮结束-->
	</body>
	<script src="js/base/av-min-2.1.2.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/base/jquery-2.1.4.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/base/vue.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript">
		window.onload = function() {
			var email= sessionStorage.getItem("email");
			if(sessionStorage.getItem("userName")) {
				var APP_ID = 'hN1kSQf2DQ9awcJmwEmIIdVo-gzGzoHsz';
				var APP_KEY = 'aHCVjhhcyeerTEsKObkGSyd6';
				AV.init({
					appId: APP_ID,
					appKey: APP_KEY
				});
				var query = new AV.Query('bike_history');
				query.find().then(function(results) {

						console.log(results)
					
					for(var i = 0; i < results.length; i++) {
						if (results[i].attributes.email == email) {
						console.log(results[i].attributes)
							obj = {
							createdAt: results[i].createdAt,
							updatedAt: results[i].updatedAt,
							bikeNumber: results[i].attributes.bikeNumber,
							bikeTime: results[i].attributes.bikeTime,
							pay: results[i].attributes.pay
						}
						vue.list.push(obj)
						}

						
					}
				}, function(error) {});
			} else {
				location.href = 'login.html'
			}
		}
		
		var vue = new Vue({
		el: "body",
		data: {
			list: []
		},
		methods: {
			remove: function(index) {
				console.log(index.item);
				var todo = AV.Object.createWithoutData('bike_info', index.item.id);
				todo.destroy().then(function(success) {
					// 删除成功
					alert("删除成功")
				}, function(error) {
					// 删除失败
				});
			}
		}
	})
	</script>

</html>